#include <stdio.h>
#include "Engine.h"

#ifdef _DEBUG
#ifdef _WIN
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#endif
#endif


int main(int /*argc*/, char** /*argv*/) 
{
#ifdef _DEBUG
	#ifdef _WIN
	//memory leak
	_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif
#endif

	CEngine engine;
	try
	{
		engine.init();
		engine.load();
		engine.start();

	}
	catch (char *msg) 
	{
		printf("Execution exception. Error : %s\n", msg);
		return -1;
	}
	engine.quit();

#ifdef _DEBUG
	//system("pause");
#endif
	return 0;
}
